import instance from '@/utils/http'

/**
 *  获取openId
 */
export const getOpenId = (wxCode: string) => instance.get('/custom/client/custom/getOpenId/' + wxCode)
/**
 * 获取用户信息
 */
export const getUserInfo = async (id: String) => instance.get('/custom/client/custom/detail', { id: id })
/**
 *  获取vip
 */
export const getVip = () => instance.get('/custom/client/vip/getVip')
/**
 * 更新用户
 * @param data 
 */
export const updateCustom = (data: any) => instance.put('/custom/client/custom/update', data)
/**
 *  获取账户信息
 */
export const getAccount = () => instance.get('/custom/client/account/getAccount')
/**
 * 添加地址
 * @param data 
 */
export const addAddress = (data: any) => instance.post('/custom/client/address/add', data)
/**
 * 更新地址
 * @param data 
 */
export const updateAddress = (data: any) => instance.put('/custom/client/address/update', data)
/**
 * 删除地址
 * @param id 
 */
export const deleteAddress = (id: String) => instance.delete('/custom/client/address/delete/' + id)
/**
 * 地址详情
 * @param id 
 */
export const detailAddress = (id: String) => instance.get('/custom/client/address/getDetail/' + id)
/**
 * 地址列表
 * @param data 
 */
export const listAddress = () => instance.get('/custom/client/address/list')

